/*
 * Copyright (c) 2022-present Charles7c Authors. All Rights Reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package top.continew.admin.category.model.req;

import java.io.Serial;

import jakarta.validation.constraints.*;

import lombok.Data;

import io.swagger.v3.oas.annotations.media.Schema;

import org.hibernate.validator.constraints.Length;

import top.continew.starter.extension.crud.model.req.BaseReq;

/**
 * 创建或修改分类信息
 *
 * @author floyd
 * @since 2024/11/13 15:26
 */
@Data
@Schema(description = "创建或修改分类信息")
public class CategoryReq extends BaseReq {

    @Serial
    private static final long serialVersionUID = 1L;

    /**
     * 分类名称
     */
    @Schema(description = "分类名称")
    @NotBlank(message = "分类名称不能为空")
    @Length(max = 30, message = "分类名称长度不能超过 {max} 个字符")
    private String name;

    /**
     * 分类编码
     */
    @Schema(description = "分类编码")
    @Length(max = 50, message = "分类编码长度不能超过 {max} 个字符")
    private String code;

    /**
     * 跳转URL
     */
    @Schema(description = "跳转URL")
    @Length(max = 500, message = "跳转URL长度不能超过 {max} 个字符")
    private String targetUrl;

    /**
     * 类型
     */
    @Schema(description = "类型")
    private Integer categoryType;

    /**
     * 图片
     */
    @Schema(description = "图片")
    private String picture;

    /**
     * 父节点ID
     */
    @Schema(description = "父节点ID")
    @NotNull(message = "父节点ID不能为空")
    private Long parentId;

    /**
     * 分类排序
     */
    @Schema(description = "分类排序")
    @NotNull(message = "分类排序不能为空")
    private Integer sort;

    /**
     * 状态（1：启用；2：禁用）
     */
    @Schema(description = "状态（1：启用；2：禁用）")
    @NotNull(message = "状态（1：启用；2：禁用）不能为空")
    private Integer status;

    /**
     * 描述
     */
    @Schema(description = "描述")
    @Length(max = 200, message = "描述长度不能超过 {max} 个字符")
    private String description;

}